home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 125
/
Freelog_MarsAvril2015_No125.iso
/
Musique
/
Quod Libet
/
quodlibet-3.3.0-installer.exe
/
bin
/
quodlibet
/
ext
/
covers
/
musicbrainz.pyc
(
.txt
)
< prev
Wrap
Python Compiled Bytecode
|
2014-12-31
|
2KB
|
53 lines
# Source Generated with Decompyle++
# File: in.pyc (Python 2.7)
from os import path
from gi.repository import Soup
from quodlibet.plugins.cover import CoverSourcePlugin, cover_dir
from quodlibet.util.cover.http import HTTPDownloadMixin
from quodlibet.util.path import escape_filename
class MusicBrainzCover(CoverSourcePlugin, HTTPDownloadMixin):
PLUGIN_ID = 'musicbrainz-cover'
PLUGIN_NAME = _('MusicBrainz cover source')
PLUGIN_DESC = _("Download covers from musicbrainz's cover art archive")
PLUGIN_VERSION = '1.0'
def group_by(cls, song):
return song.get('musicbrainz_albumid', None)
group_by = classmethod(group_by)
def priority():
return 0.65
priority = staticmethod(priority)
def cover_path(self):
mbid = self.mbid
if mbid is None:
return super(MusicBrainzCover, self).cover_path
return None.join(cover_dir, escape_filename(mbid))
cover_path = property(cover_path)
def mbid(self):
return self.song.get('musicbrainz_albumid', None)
mbid = property(mbid)
def url(self, front = True):
if not self.mbid:
return None
mbid = None.URI.encode(self.mbid, None)
return 'http://coverartarchive.org/release/{0}/front'.format(mbid)
url = property(url)
def fetch_cover(self):
if not self.mbid:
return self.fail('MBID is required to fetch the cover')
None.download(Soup.Message.new('GET', self.url))